/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-14
 * Time: 14:34
 */
public class Test2 {
    public  static void func(int a)/*throws ArithmeticException*/{
        if(a==0){
            throw new ArithmeticException("分母不能为0");
        }
    }
    public static void main(String[] args) {
        try {
            func(0);
        }catch(ArithmeticException e){
            System.out.println("分母不能为0");
            e.printStackTrace();
        }
    }
}
